summaryrefslogtreecommitdiffstats
path: root/src/android/app/src/main/java/org/citra/citra_emu/viewholders/GameViewHolder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/android/app/src/main/java/org/citra/citra_emu/viewholders/GameViewHolder.java')
-rw-r--r--src/android/app/src/main/java/org/citra/citra_emu/viewholders/GameViewHolder.java46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/android/app/src/main/java/org/citra/citra_emu/viewholders/GameViewHolder.java b/src/android/app/src/main/java/org/citra/citra_emu/viewholders/GameViewHolder.java
new file mode 100644
index 000000000..50dbcbe18
--- /dev/null
+++ b/src/android/app/src/main/java/org/citra/citra_emu/viewholders/GameViewHolder.java
@@ -0,0 +1,46 @@
+package org.citra.citra_emu.viewholders;
+
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.recyclerview.widget.RecyclerView;
+
+import org.citra.citra_emu.R;
+
+/**
+ * A simple class that stores references to views so that the GameAdapter doesn't need to
+ * keep calling findViewById(), which is expensive.
+ */
+public class GameViewHolder extends RecyclerView.ViewHolder {
+ private View itemView;
+ public ImageView imageIcon;
+ public TextView textGameTitle;
+ public TextView textCompany;
+ public TextView textFileName;
+
+ public String gameId;
+
+ // TODO Not need any of this stuff. Currently only the properties dialog needs it.
+ public String path;
+ public String title;
+ public String description;
+ public String regions;
+ public String company;
+
+ public GameViewHolder(View itemView) {
+ super(itemView);
+
+ this.itemView = itemView;
+ itemView.setTag(this);
+
+ imageIcon = itemView.findViewById(R.id.image_game_screen);
+ textGameTitle = itemView.findViewById(R.id.text_game_title);
+ textCompany = itemView.findViewById(R.id.text_company);
+ textFileName = itemView.findViewById(R.id.text_filename);
+ }
+
+ public View getItemView() {
+ return itemView;
+ }
+}